<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模板字符串</title>
</head>
<body>
<p>使用模板字串使用撇号`，模板字串中如果要引用变量使用＄{变量名称}</p>
<script>
    var name = "飞扬";
    var address = "南阳";
    var habby = "music"
    // 传统的字串拼接方式
    var info ="我是"+ name+ "来自"+address+"爱好"+habby;
    console.log(info);//我是飞扬来自南阳爱好music

    //使用模板字串拼接
    var info1 = `我是${name}, 来自${address},我喜欢${habby}`;
    console.log(info1);//我是飞扬, 来自南阳,我喜欢music
</script>
</body>
</html>